# 演示CMAKE_C_FLAGS的影响范围

cmake_minimum_required(VERSION 3.15)

project(test_cmake_c_flags C)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DAAA")
add_executable(main1 main1.c)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBBB")
include(suba/suba.cmake)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCCC")
add_subdirectory(subb)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDDD")
add_subdirectory(subc)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DEEE")
add_executable(main2 main2.c)